package com.example.springbootmybatis.service.impl;

import com.example.springbootmybatis.domain.User;
import com.example.springbootmybatis.mapper.UserMapper;
import com.example.springbootmybatis.service.UserService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;
import java.util.Map;


@Service
public class UserServiceImpl implements UserService {

    @Resource
    private UserMapper userMapper;

    @Override
    public List<User> getAllUsers() {
        return userMapper.selectUserList();
    }

    @Override
    public User selectUserById(Integer id) {
        return userMapper.selectUserById(id);
    }

    @Override
    public List<User> getAllUsersByCond(Map<String, Object> map) {
        return userMapper.getAllUsersByCond(map);
    }

    @Override
    public int insertUser(User user) {
        return userMapper.insertUser(user);
    }

    @Override
    public List<User> selectUserListBytDynamic(User user) {
        return userMapper.selectUserListBytDynamic(user);
    }

    @Override
    public int updateByDynamic(User user) {
        return userMapper.updateByDynamic(user);
    }

    @Override
    public List<User> getUserOrderList() {
        return userMapper.getUserOrderList();
    }
}
